// 平台属性管理模块的请求文件
import request from '@/utils/request'

//1.获取图片的数据  URL：/admin/product/spuImageList/{spuId} 请求方式：GET
export const reqSpuImageList = (spuId)=>{
    return  request({url:`/admin/product/spuImageList/${spuId}`,method:'get'})
}


//2.获取销售属性的数据  URL：/admin/product/spuSaleAttrList/{spuId} 请求方式：GET
export const reqSaleAttrList = (spuId)=>{
    return  request({url:`/admin/product/spuSaleAttrList/${spuId}`,method:'get'})
}

//3.获取商品基础数据接口 URL:/admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id} 请求方式：get
export const reqAttrInfoList = (category1Id,category2Id,category3Id) =>{
    return request({url:`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,method:'get'})
}

//4.添加Spu    URL:/admin/product/saveSkuInfo   method:'post'
export const reqAddSku = (skuInfo) =>{
    //携带的参数带有id---修改spu
        return request({url:'/admin/product/saveSkuInfo',method:'post',data:skuInfo})
}

//5.根据Spuid获取sku列表  URL：/admin/product/findBySpuId/{spuId}  method:'get'
export const reqSkuList = (spuId) =>{
    //携带的参数带有id---修改spu
        return request({url:`/admin/product/findBySpuId/${spuId}`,method:'get'})
}

/* ******************************************************* */
// 1.获取sku列表基础的接口信息  URL：/admin/product/list/{page}/{limit}  method:'get'
export  const reqSkuBaseList = (page,limit) =>{
    return request({url:`/admin/product/list/${page}/${limit}`,method:'get'})
} 

// 2.sku上架请求   URL：/admin/product/onSale/{skuId} method:'get'
export const reqOnSale = (skuId)=>{
     return request({url:`/admin/product/onSale/${skuId}`,method:'get'})
} 

// 3.sku下架请求   URL：/admin/product/cancelSale/{skuId} method:'get'
export const reqCancelSale = (skuId)=>{
    return request({url:`/admin/product/cancelSale/${skuId}`,method:'get'})
} 

// 4.获取SKU详情的接口 URL：/admin/product/getSkuById/{skuId} method:'get'
export const reqSkuById = (skuId)=>{
    return request({url:`/admin/product/getSkuById/${skuId}`,method:'get'})
}